import {createRouter,createWebHashHistory} from 'vue-router'

let routes = [
    {
        path:'/login',
        name:'login',
        meta: { 
            name:'登录页'
         },
        component:()=>import ('../pages/login/index.vue')
    },
    {
        path:'/',
        name:'/',
        meta: { 
            name:'首页'
         },
        component:()=>import ('../pages/home/index.vue'),
        children:[
            {
                path:'main',
                name:'main',
                meta:{
                    name:'个人中心'
                },
                component:()=>import ('../pages/main/index.vue')
            },
            {
                path:'parent',
                name:'parent',
                meta:{
                    name:'父节点'
                },
                component:()=>import ('../pages/parent/index.vue'),
                children:[
                    {
                        path:'child',
                        name:'child',
                        meta:{
                            name:'子节点'
                        },
                        component:()=>import ('../pages/parent/child/index.vue')
                    }
                ]
            },
            {
                path:'songs',
                name:'songs',
                meta:{
                    name:'歌曲'
                },
                component:()=>import ('../pages/songs/index.vue')
            }
        ]
    }
]

let router = createRouter({
    history:createWebHashHistory('/base'),
    routes
})
export default router